package design.One;

import java.io.Serializable;
import java.util.Objects;

/**
 * Created by looper on 2017/8/14.
 */
public class Woman implements Person  , Serializable {
  private Integer age;

  private String name;





  public Woman() {

  }


  public Woman(Integer age, String name) {
    this.age = age;
    this.name = name;
  }

  public Integer getAge() {
    return age;
  }

  public void setAge(Integer age) {
    this.age = age;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    Woman woman = (Woman) o;
    return Objects.equals(age, woman.age) && Objects.equals(name, woman.name);
  }

  @Override
  public int hashCode() {
    return Objects.hash(age, name);
  }

  @Override
  public String toString() {
    return "Woman{" +
            "age=" + age +
            ", name='" + name + '\'' +
            '}';
  }

  @Override
  public String say() {
    return "一个女人在说话";
  }
}
